#include <stdio.h>
#include <stdbool.h>
#include "./data_structure/linear_structure/sequence_list.h"
#include "./data_structure/linear_structure/link_list.h"
#include "./data_structure/linear_structure/inn.h"
#include "./data_structure/search/binarySearch.h"
int main()
{
    LinkStack S;
    InitStack_link(&S);
    // 入栈测试
    Push_link(&S, 1);
    Push_link(&S, 2);
    Push_link(&S, 3);
    Push_link(&S, 4);
    PrintStack_link(S);
    int topElem;
    if (GetTop_link(S, &topElem))
    {
        printf("栈顶元素为：%d\n", topElem);
    }
    // 出栈测试
    int popElem;
    Pop_link(&S, &popElem);
    printf("出栈元素为： ↑ %d ", popElem);
    PrintStack_link(S);
    printf("-------清空栈操作--------\n");
    ClearStack_link(&S);
    printf("栈是否清空: %s \n", StackEmpty_link(S) ? "true" : "false");
    printf("重新添加栈中元素，");
    Push_link(&S, 1);
    Push_link(&S, 2);
    Push_link(&S, 3);
    Push_link(&S, 4);
    printf("栈长度为：%d\n", StackLength_link(S));
    ClearStack_link(&S);
    return 0;
}
